<%@ Page Title="Dashboard" Language="C#" MasterPageFile="~/Pages/admin/adminMaster.Master" AutoEventWireup="true" CodeBehind="Dashboard.aspx.cs" Inherits="WarehouseWebAPP.Pages.admin.Dashboard" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style24
        {
            width: 680px;
            height: 226px;
        }
        .style26
        {
            height: 229px;
        }
        .style27
        {
            height: 22px;
        }
        .style28
        {
            width: 391px;
            height: 21px;
        }
        .style29
        {
            height: 26px;
        }
        .style33
        {
            width: 391px;
            height: 226px;
        }
        .style35
        {
            width: 256px;
            height: 226px;
        }
        .style37
        {
            width: 256px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style1">
        <tr>
        <td class="style28" valign="top">
                    <asp:Label ID="Label4" runat="server" Text="Recent Updates" Font-Bold="True" 
                        Font-Size="Large" Font-Underline="True" ForeColor="#5D7B9D"></asp:Label>
        </td>
        <td valign="top" class="style37" align="center">
            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                <ContentTemplate>
                    <asp:Label ID="ClockLabel" runat="server" BackColor="#5D7B9D" 
                        ForeColor="White" onload="ClockLabel_Load" Text="Label"></asp:Label>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Timer2" EventName="Tick" />
                </Triggers>
            </asp:UpdatePanel>
        </td>
        </tr>
        <tr>
        <td class="style33" valign="top">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="Panel1" runat="server" Width="379px" BorderColor="#99CCFF" 
                        BorderStyle="Solid" BorderWidth="1px" Height="239px">
                        <asp:DataList ID="NewsDataList" runat="server" BackColor="White" CellPadding="1" 
                            DataSourceID="EventsObjectDataSource" Font-Bold="False" Font-Italic="False" 
                            Font-Overline="False" Font-Size="Medium" Font-Strikeout="False" 
                            Font-Underline="False" ForeColor="Black" GridLines="Horizontal" Height="232px" 
                            HorizontalAlign="Left" RepeatColumns="1" RepeatLayout="Flow" Width="373px">
                            <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                            <ItemStyle Font-Size="Small" />
                            <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                            <ItemTemplate>
                                &nbsp;<asp:Label ID="New" runat="server" Text='New: ' ForeColor="#0033CC" />
                                <asp:Label ID="LengthLabel" runat="server" Text='<%# Eval("message") %>' />
                                <br />
                            </ItemTemplate>
                        </asp:DataList>
                    </asp:Panel>
                    <br />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                </Triggers>
            </asp:UpdatePanel>
        </td>
        <td class="style35" valign="top">
            <img alt="" src="../images/control.jpg" 
                style="width: 240px; height: 212px; margin-left: 0px;" /></td>
        <td class="style24" valign="top">
            &nbsp;</td>
        </tr>
    <tr>
        <td class="style27" colspan="3" valign="top" align="center" bgcolor="Maroon">
                    <asp:Label ID="Label5" runat="server" Text="System Alerts" 
                        Font-Bold="True" Font-Underline="True" ForeColor="White" 
                        Font-Size="Large"></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style26" colspan="3" valign="top">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <cc1:TabContainer ID="AlertsTabContainer" runat="server" ActiveTabIndex="0" 
                        Width="650px" ForeColor="Black">
                                <cc1:TabPanel runat="server" HeaderText="Components" ID="Components">
                                    <HeaderTemplate>
                                        Components
                                    </HeaderTemplate>
                                    <ContentTemplate>
                                        <asp:GridView ID="ComponentGridView" runat="server" AllowPaging="True" 
                                AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                DataKeyNames="component_num" DataSourceID="ComponentObjectDataSource" 
                                ForeColor="#333333" GridLines="None" BorderColor="#9999FF" 
                                ondatabound="ComponentGridView_DataBound" PageSize="5" Width="620px">
                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                            <Columns>
                                                <asp:BoundField DataField="component_num" HeaderText="component_num" 
                                        ReadOnly="True" SortExpression="component_num" Visible="False" />
                                                <asp:TemplateField HeaderText="Component No." 
                                        SortExpression="component_serial_num">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox1" runat="server" 
                                                Text='<%# Bind("component_serial_num") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="SNLabel" runat="server" 
                                                Text='<%# Bind("component_serial_num") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Vendor" SortExpression="component_vendor">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox3" runat="server" 
                                                Text='<%# Bind("component_vendor") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="VendorLabel" runat="server" 
                                                Text='<%# Bind("component_vendor") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="component_description" 
                                        HeaderText="component_description" SortExpression="component_description" 
                                        Visible="False" />
                                                <asp:BoundField DataField="component_place" HeaderText="component_place" 
                                        SortExpression="component_place" Visible="False" />
                                                <asp:BoundField DataField="component_quantity" HeaderText="Quantity" 
                                        SortExpression="component_quantity" />
                                                <asp:TemplateField HeaderText="Supplier" SortExpression="component_supplier">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox2" runat="server" 
                                                Text='<%# Bind("component_supplier") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="SupplierLabel" runat="server" 
                                                Text='<%# Bind("component_supplier") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <EditRowStyle BackColor="#999999" />
                                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                                                HorizontalAlign="Left" />
                                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                        </asp:GridView>
                                    </ContentTemplate>
                                </cc1:TabPanel>
                                <cc1:TabPanel runat="server" HeaderText="Lends" ID="Lends">
                                    <ContentTemplate>
                                        <asp:GridView ID="LendGridView" runat="server" AllowPaging="True" 
                                AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                                DataKeyNames="lend_num" DataSourceID="LendsObjectDataSource" 
                                ForeColor="#333333" GridLines="None"  
                                ondatabound="LendGridView_DataBound" PageSize="5" Width="626px">
                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                            <Columns>
                                                <asp:BoundField DataField="lend_num" HeaderText="lend_num" ReadOnly="True" 
                                        SortExpression="lend_num" Visible="False" />
                                                <asp:TemplateField HeaderText="Item Serial No." SortExpression="lend_item_num">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lend_item_num") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="ItemLabel" runat="server" Text='<%# Bind("lend_item_num") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Customer" SortExpression="lend_customer">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("lend_customer") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="CustomerLabel" runat="server" 
                                                Text='<%# Bind("lend_customer") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="User" SortExpression="lend_user">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("lend_user") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="UserLabel" runat="server" Text='<%# Bind("lend_user") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="lend_start_date" HeaderText="Lend Start Date" 
                                        SortExpression="lend_start_date" />
                                                <asp:BoundField DataField="lend_end_date" HeaderText="Lend End Date" 
                                        SortExpression="lend_end_date" />
                                                <asp:BoundField DataField="lend_returned_date" HeaderText="lend_returned_date" 
                                        SortExpression="lend_returned_date" Visible="False" />
                                            </Columns>
                                            <EditRowStyle BackColor="#999999" />
                                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                        </asp:GridView>
                                    </ContentTemplate>
                                </cc1:TabPanel>
                            </cc1:TabContainer>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                        </Triggers>
                    </asp:UpdatePanel>
        </td>
    </tr>
    <tr>
        <td class="style29" colspan="3" valign="top" align="justify">
                    <asp:ObjectDataSource ID="EventsObjectDataSource" runat="server" 
                        SelectMethod="GetEvents" 
                TypeName="WarehouseWebAPP.code.BLL.History">
                    </asp:ObjectDataSource>
            <asp:Timer ID="Timer1" runat="server" Interval="10000" ontick="Timer1_Tick">
            </asp:Timer>
                    <asp:Timer ID="Timer2" runat="server" Interval="1000" ontick="Timer2_Tick">
                    </asp:Timer>
                    <asp:ObjectDataSource runat="server" SelectMethod="LendGetAlerts" 
                        TypeName="WarehouseWebAPP.code.BLL.LendBLL" ID="LendsObjectDataSource">
                    </asp:ObjectDataSource>
                    <asp:ObjectDataSource ID="ComponentObjectDataSource" runat="server" 
                        SelectMethod="ComponentGetLessthanQuantity" 
                        TypeName="WarehouseWebAPP.code.BLL.ComponentBLL">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="5" Name="component_quantity" Type="Int32" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
        </td>
    </tr>
    </table>
</asp:Content>
